/**
 * Created by 小敏哥 on 2017/8/11.
 */
import React, {Component} from 'react';
import style from './index.scss';


class TitleAndDetail extends Component {
    constructor(props) {
        super(props);
    }

    static propTypes = {
        title:React.PropTypes.string,//标题
        content:React.PropTypes.string,//详情
        showIcon:React.PropTypes.bool,//是否显示提示icon
        iconClick:React.PropTypes.func//icon点击回调
    };


    render(){
        return <div className={style.container}>
            <div className={style.title}>
                <h2>{this.props.title}</h2>
                {this.props.showIcon?<div className={style.img} onClick={()=>{this.props.iconClick&&this.props.iconClick()}}></div>:''}
            </div>
            <p>{this.props.content}</p>
        </div>
    }
}

export default TitleAndDetail